Skip to content

Feat/indexer optimisation - #206

Open
zahorodnyi wants to merge 3 commits into
devfrom
feat/indexer-optimisation
Open

zahorodnyi wants to merge 3 commits into
devfrom
feat/indexer-optimisation

Conversation

@zahorodnyi

Copy link
Copy Markdown
Collaborator

This PR fixes the XF-16 issue

@zahorodnyi zahorodnyi self-assigned this Nov 22, 2026
@zahorodnyi
zahorodnyi requested a review from Hrom131 as a code owner November 22, 2026 11:56

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of updating the offer_participants table, let's just add a view for latest_offer_participants. All the information needed to retrieve the latest participants is already there, and using a view will ensure that queries don't have any performance issues.

latest_offer_participants view example:

CREATE VIEW latest_offer_participants AS
SELECT participant.*
FROM offer_participants participant
WHERE NOT EXISTS (
    SELECT 1
    FROM offer_participants successor
    WHERE successor.txid = participant.spent_txid
      AND successor.offer_id = participant.offer_id
      AND successor.participant_type = participant.participant_type
);

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants